package espacokidsadm.modelo.dao.impl;

import espacokidsadm.modelo.dao.Dao;
import espacokidsadm.modelo.entity.Responsavel;


public class ResponsavelDAO extends Dao {

	private static final long serialVersionUID = -8652566999470645721L;
	
	public Responsavel salvar(Responsavel responsavel) {
		
		if(responsavel.getId().getPessoa().getId() == null)
			getEm().persist(responsavel);
		else
			getEm().merge(responsavel);
		
		return responsavel;
		
	}


	/*public Responsavel getById(Integer id) {
		return getPojo(Responsavel.class, id);
	}

	public List<Responsavel> getTodos() {
		return getList(Responsavel.class, "select responsavel from Responsavel responsavel order by responsavel.nomeResponsavel");
	}
*/
}
